﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ArticleList.aspx.cs" Inherits="Admin_ArticleList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>资讯列表</title>
    <link href="skin/css/base.css" rel="stylesheet" type="text/css" />
    <link href="skin/css/main.css" rel="stylesheet" type="text/css" />
    <script src="../script/jquery-1.9.1.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="ArtileHeader">
        分类：<asp:DropDownList ID="drpCategory" runat="server">
        </asp:DropDownList>
        &nbsp;关键词：<asp:TextBox ID="txtKeyWord" runat="server" Width="237px"></asp:TextBox>
        &nbsp;标题：<asp:TextBox ID="txtTitle" runat="server" Width="237px"></asp:TextBox>
        &nbsp;标签：<asp:TextBox ID="txtTag" runat="server" Width="237px"></asp:TextBox>
        <br />
        是否精华：<asp:DropDownList runat="server" ID="drpIsChoice">
            <asp:ListItem Text="请选择" Value="-1"></asp:ListItem>
            <asp:ListItem Text="是" Value="1"></asp:ListItem>
            <asp:ListItem Text="否" Value="0"></asp:ListItem>
        </asp:DropDownList>
        是否标记：<asp:DropDownList runat="server" ID="drpIsTag">
            <asp:ListItem Text="请选择" Value="-1"></asp:ListItem>
            <asp:ListItem Text="是" Value="1"></asp:ListItem>
            <asp:ListItem Text="否" Value="0"></asp:ListItem>
        </asp:DropDownList>
        是否热门：<asp:DropDownList runat="server" ID="drpIsHot">
            <asp:ListItem Text="请选择" Value="-1"></asp:ListItem>
            <asp:ListItem Text="是" Value="1"></asp:ListItem>
            <asp:ListItem Text="否" Value="0"></asp:ListItem>
        </asp:DropDownList>
        &nbsp;<asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" />
        &nbsp;<asp:Button ID="btnAdd" runat="server" Text="添加" OnClick="btnAdd_Click" />
        &nbsp;<asp:Button ID="btnCreate" runat="server" Text="生成" OnClick="btnCreate_Click" />
    </div>
    <div>
        <table cellpadding="1" cellspacing="1">
            <tr class="trHeader">
                <td style="width: 4%">
                    <asp:CheckBox runat="server" ID="ckbAllSel" Text="全选" OnCheckedChanged="ckbAllSel_CheckedChanged"
                        AutoPostBack="True" />
                </td>
                <td style="width: 3%">
                    Id
                </td>
                <td style="width: 15%">
                    标题
                </td>
                <td style="width: 23%">
                    关键词
                </td>
                 
                <td style="width: 5%">
                    封面图片1
                </td>
                <td style="width: 5%">
                    封面图片2
                </td>
                <td style="width: 5%">
                    封面图片3
                </td>
                <td style="width: 5%">
                    封面图片4
                </td>
                <td style="width: 5%">
                    封面图片5
                </td>
                <td style="width: 5%">
                    发布人
                </td>
                <td style="width: 10%">
                    发布时间
                </td>
                <td style="width: 10%">
                    操作
                </td>
            </tr>
            <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand" OnItemDataBound="rptList_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:CheckBox runat="server" ID="ckbSel" />
                            <asp:HiddenField runat="server" ID="hid" Value='<%#Eval("Id") %>' />
                        </td>
                        <td>
                            <%#Eval("Id") %>
                        </td>
                        <td>
                            <%#Eval("CreateUrl").ToString().Length > 0 ? "<a href='" + Eval("CreateUrl") + "' target=\"_blank\">" + Eval("ArticleTitle") + "</a>" : Eval("ArticleTitle")%>
                        </td>
                        <td>
                            <%#Eval("KeyWord")%>
                        </td>
                        <%--<td>
                            <%#Eval("ArticleContent").ToString().Length > 50 ? HttpUtility.HtmlDecode(Eval("ArticleContent").ToString()).Substring(0, 50) : HttpUtility.HtmlDecode(Eval("ArticleContent").ToString())%>
                        </td>--%>
                        <td>
                            <%#Eval("PicCoverUrl1").ToString().Length > 0 ? "<img height=\"50px\" width=\"50px\" src='" + Eval("PicCoverUrl1") + "' alt=\"\" />" : "无"%>
                        </td>
                        <td>
                            <%#Eval("PicCoverUrl2").ToString().Length > 0 ? "<img height=\"50px\" width=\"50px\" src='" + Eval("PicCoverUrl2") + "' alt=\"\" />" : "无"%>
                        </td>
                        <td>
                            <%#Eval("PicCoverUrl3").ToString().Length > 0 ? "<img height=\"50px\" width=\"50px\" src='" + Eval("PicCoverUrl3") + "' alt=\"\" />" : "无"%>
                        </td>
                        <td>
                            <%#Eval("PicCoverUrl4").ToString().Length > 0 ? "<img height=\"50px\" width=\"50px\" src='" + Eval("PicCoverUrl4") + "' alt=\"\" />" : "无"%>
                        </td>
                        <td>
                            <%#Eval("PicCoverUrl5").ToString().Length > 0 ? "<img height=\"50px\" width=\"50px\" src='" + Eval("PicCoverUrl5") + "' alt=\"\" />" : "无"%>
                        </td>
                        <td>
                            <%# GetUser(Convert.ToInt32(Eval("PublishPeopleId")))%>
                        </td>
                        <td>
                            <%#Eval("CreateDate")%>
                        </td>
                        <td>
                            <asp:Button runat="server" ID="btnDel" Text="删" CommandArgument='<%#Eval("Id") %>'
                                CommandName="Del" />
                            <asp:Button runat="server" ID="btnUpdate" Text="编" CommandArgument='<%#Eval("Id") %>'
                                CommandName="Update" />
                            <asp:Button runat="server" ID="btnSetHot" Text="加热" CommandArgument='<%#Eval("Id") %>'
                                CommandName="Hot" />
                            <asp:Button runat="server" ID="btnUnSetHot" Text="去热" CommandArgument='<%#Eval("Id") %>'
                                CommandName="UnHot" />
                            <asp:Button runat="server" ID="btnSetTag" Text="加标" CommandArgument='<%#Eval("Id") %>'
                                CommandName="Tag" />
                            <asp:Button runat="server" ID="btnUnSetTag" Text="去标" CommandArgument='<%#Eval("Id") %>'
                                CommandName="UnTag" />
                            <asp:Button runat="server" ID="btnSetChoice" Text="加精" CommandArgument='<%#Eval("Id") %>'
                                CommandName="Choice" />
                            <asp:Button runat="server" ID="btnUnSetChoice" Text="去精" CommandArgument='<%#Eval("Id") %>'
                                CommandName="UnChoice" />
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
    </div>
    <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" 
        LastPageText="尾页" NextPageText="下一页" onpagechanged="AspNetPager1_PageChanged" 
        PrevPageText="上一页">
    </webdiyer:AspNetPager>
    </form>
</body>
<script language="javascript" type="text/javascript">
    //全选or不全选
    function Selectckb() {
        alert($("#ckbAllSelect").attr("checked"));
        if ($("#ckbAllSelect").attr("checked") == "checked") {

            $("[name=checkbox]:checkbox").attr("checked", true);
        }
        else {
            $("[name=checkbox]:checkbox").attr("checked", false);
        }
    }
         
</script>
</html>
